In SvelteKit, you can disable server-side rendering for a specific page by exporting a prerender or ssr option in the page’s +page.js (or +page.ts) file. This is useful for pages that rely entirely on client-side logic or dynamic browser-only APIs.
With ssr = false, SvelteKit will skip server-side rendering for this page, and the page will be rendered entirely in the browser like a traditional SPA.
Pages that rely on browser-only APIs like window or document.
Highly dynamic pages that do not need SEO or initial render optimization.
Dashboard or admin interfaces where client-side interactivity dominates.
Third-party scripts that cannot run on the server.
Disabling SSR reduces server load but may affect SEO and first-paint performance.
You can still fetch data client-side using onMount or fetch when SSR is disabled.
SSR can be disabled on a per-page basis; other pages can still benefit from SSR.